<!DOCTYPE html>
<html>
    <head> 
       <meta charset="utf-8" />
       <title>Login</title>	   
	   
		<script language="javascript" type="text/javascript" src="jquery.js"></script>
		<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
		<script>
			$(document).ready(function() 
			{  
				var checking_html = 'Checking...';  
  $('#message').html("clicked");  
				//when button is clicked  
				$('#submit').click(function()
				{ 
					$('#message').html('clicked');  
					check();
				});  
		    });  
			
			
  
			//function to check password
			function check()
			{  
				//get the username  
				var username = $('#username').val();  
				var 
			  
				//use ajax to run the check  
				$.post("login.php", { username: username, password: password },  
					function(result){  
					//if the result is 1  
					if(result == 1){  
						//show that the username is available  
						$('#message').html('OK');  
					}else{  
						//show that the username is NOT available  
						$('#message').html(result);  
					}  
					
				});  			  
			}  
		</script>-->
		
		
	  
    </head>
    <body>
		<h1>Login</h1>
		
		<!--
		<form method="post" name="aform">
		<table>
			<tr><td>Username:</td><td><input type="text" name="login" id="username"></td></tr>
			<tr><td>Password:</td><td><input type="password" name="password" id="password"></td></tr>
			<tr><td>&nbsp;</td><td><input type="submit" value="Log in" id="submit"></td></tr>
			</table>
		</form>-->
		<table>
			<tr><td>Username:</td><td><input type="text" name="login" id="username"></td></tr>
			<tr><td>Password:</td><td><input type="password" name="password" id="password"></td></tr>
			<tr><td>&nbsp;</td><td><input type="button" value="Log in" id="submit"></td></tr>
		</table>
		
		<div id="message">Hier komt een berichtje</div>
		<script  id="source" language="javascript" type="text/javascript">
		
			 $(function () 
			  {
				$.ajax({                                      
				  url: 'login.php',                  
				  data: "username='Koen'&password='hallo'",      
				  dataType: 'json',
				  success: function(data)  
				  {
					var text = data[0]; 
				
					$('#message').html(text);
				  } 
				});
			  }); 
		</script>
    </body>
</html>
